<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
<head>
<title>Dojo XHR Example</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js" djConfig="parseOnLoad:true, isDebug: false"></script>
 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAv55cC37g-7Kq0tZb3OOnqRTwM0brOpm-All5BF6PoaKBxRWWERRopPeKbGp5uXcFQgkoxJ3wFnVHvA" type="text/javascript"></script>
 <script type="text/javascript">
 
 var map = null;
 
 function handleResponse( response, arguments ){
 
    var entries = response.getElementsByTagName( "field" );
    
    for( var entry = 0; entry < entries.length; entry++ )
    {
       var lat = entries[entry].getAttribute( "lat" );
       
       var lng = entries[entry].getAttribute( "long" );
       
       console.log( "LONG: " + lng );
       
       var point = new GLatLng( lat, lng );
       
       map.addOverlay( new GMarker( point ) );  
    }
 }
 
 function initializeMap(){
 
   if( GBrowserIsCompatible() )
   {
       map = new GMap2(document.getElementById("map_canvas"));
       map.setCenter(new GLatLng(45.2936880, -75.8653990 ), 13);
       map.setUIToDefault();
   }
 
 }
 
 function start(){
    initializeMap();
    
    var serviceobject = { url:"http://localhost:8081/fields.xml", handleAs:"xml", load: handleResponse };
    
    dojo.xhrGet( serviceobject );
    
 }

dojo.addOnLoad( start );
  
</script>
<body class="tundra" >
   <div>Dojo Map Application</div>
   <div id="map_canvas" style="width:500px;height:400px"></div>
</body>
</html>

